package design_pattern.Singleton;

/**
 * @Author: 蔡翔
 * @Date: 2019/10/23 14:29
 * @Version 1.0
 *
 * 懒加载的方式引出多线程安全的问题。
 */
public class SingletonObject2 {
    private static SingletonObject2 instance;
    private SingletonObject2(){

    }
    private static SingletonObject2 getInstance()
    {
        if(instance == null){
            instance = new SingletonObject2();
        }
        return instance;
    }
}
